/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3E3B7754-EE60-42AC-A757-B609BAF7BFA2"}
 * @AllowToRunInFind
 */
function onShow(firstShow, event) 
{
	elements.gCod_producto.requestFocus();
	application.setNumpadEnterAsFocusNextEnabled(false);
	//  NO MOSTRAR INACTIVOS   //  23/01/2012
	if(controller.find() == false)
	{
		globals.gMensaje = 'No encontró productos (find)';
		globals.DIALOGS.showInfoDialog('Productos',  globals.gMensaje,  "OK") // 23/01/2014
		return ; 
	}
	inactivo = 0;
	if(controller.search() == 0)
	{
		globals.gMensaje = 'No encontró producto en ese rango'
		globals.DIALOGS.showInfoDialog('Productos',  globals.gMensaje,  "OK") // 23/01/2014
		return ;
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A897C1F6-F624-43B5-BFE0-C70CE7C0C48E"}
 */
function onAction_cancelar(event) 
{
	globals.gCod_producto  =null;
	application.closeForm('ver_stock_descrip');
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B2B753F2-D8C0-481D-967C-13BD121C90B2"}
 */
function onAction_elegir(event) 
{
	application.closeForm('ver_stock_descrip');
}

/**
 * Handle hide window.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"999BF629-659F-4BC5-934D-1FB53D127219"}
 */
function onHide(event) 
{ //  TODO  si no estab en true al comenzar (default) va a quedar en true=OJO 
	application.setNumpadEnterAsFocusNextEnabled(true)
	return true
}
